{include admin.inc.header}

{include admin.inc.top}

<div class="container-fluid content-body">
    <div class="main">
        {include admin.inc.menu}

        <section class="right-section" id="right-section">
            <!-- start of inner-frame -->
            <div class="inner-iframe">

                <ul class="breadcrumb">
                    <li>
                        <i class="glyphicon glyphicon-home"></i>
                        <span>当前位置：</span>
                        <a href="#">{$breadcrumb[0]}</a>
                        <i class="glyphicon glyphicon-chevron-right"></i>
                        <a href="#">{$breadcrumb[1]}</a>
                    </li>
                </ul>

                <!-- Nav tabs -->
                <ul class="nav nav-tabs">

                    <li class="active"><a href="{$index_url}"><i class="glyphicon glyphicon-th-list"></i> 资金流水</a></li>
                </ul>

                <div class="inner-container">

                    <!-- search form start -->
                    <form class="form-inline form-search" role="form" id="search-form" autocomplete="off">
                        <div class="form-group">
                            <div class="input-group">
                                <div class="input-group-btn">
                                    <select class="form-control input-sm search-options" name="select_name">
                                        <option value="serial_no" {if $params[select_name]=='serial_no'}selected{/if}>流水号</option>
                                        <option value="username" {if $params[select_name]=='username'}selected{/if}>大塑支付账号</option>
                                        <option value="order_no" {if $params[select_name]=='order_no'}selected{/if}>订单号</option>
                                    </select>
                                </div><!-- /btn-group -->
                                <input  type="text" name="serial_no" value="{$params[$params['select_name']]}" class="form-control input-sm">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="input-group">
                                <div class="input-group-addon">业务类型</div>
                                <select class="form-control input-sm" name="type">
                                    <option value="">全部</option>
                                    {loop $logTypes $key $val}
                                    <option value="{$key}" {if $params[type]==$key}selected{/if}>{$val}</option>
                                    {/loop}
                                </select>
                            </div>
                        </div>

                        <div class="form-group" id="s_register_date">
                            <div class="input-group">
                                <div class="input-group-addon">交易时间</div>
                                <div class="form-inline">
                                    <input type="text" name="starttime" value="{$params[starttime]}" class="form-control input-sm mdate" placeholder="开始日期">
                                    <input type="text" name="endtime" value="{$params[endtime]}" class="form-control input-sm mdate" placeholder="结束日期">
                                </div>
                            </div>
                        </div>

                        <button type="submit" class="btn btn-success btn-sm">
                            <i class="glyphicon glyphicon-search"></i> 搜索</button>
                        {data_export_btn}

                    </form><!-- END search form -->

                    <form id="J_List_Form" autocomplete="off">
                        <div class="table-responsive" style="overflow-x: visible;">
                            <table class="table table-bordered table-hover" id="J_List_Table">
                                <thead>
                                <tr>
                                    <th width="20"><input type="checkbox" class="icheck check-all" /></th>
                                    {loop $tableHeader $val}
                                    <th>{$val}</th>
                                    {/loop}
                                </tr>
                                </thead>
                                <tbody>
                                {if empty($items)}
                                <tr>
                                    <td class="no-records text-center">{$noRecords}</td>
                                </tr>
                                {/if}
                                {loop $items $value}
                                <tr>
                                    <td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}" id="checkbox_row_{$value[id]}" /></td>
                                    <td><label for="checkbox_row_{$value[id]}">{$value[serial_no]}</label></td>
                                    <td>{$value[username]}</td>
                                    <td>{$value[amount]}</td>
                                    <td>{$value[usable]}</td>
                                    <!--<td>{$value[out_frozen]}</td>-->
                                    <td>
                                        {if $value[atype] == '+'}
                                        <span class="label label-success">收入</span>
                                        {elseif $value[atype] == '-'}
                                        <span class="label label-danger">支出</span>
                                        {else}
                                        ---
                                        {/if}
                                    </td>
                                    <td>{$logTypes[$value[type]]}</td>
                                    <td>{if $value[order_no]}订单号：{$value[order_no]}{/if}</td>
                                    <td>{$value[addtime]}</td>
                                </tr>
                                {/loop}
                                </tbody>
                            </table>
                        </div>
                    </form>

                    <div class="text-right">
                        {$pagemenu}
                    </div>

                </div>

            </div><!-- end of inner -->
        </section>

    </div>
</div>

{include admin.inc.footer}

<script type="text/html" id="modify-mobile-template">
    <form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 新会员名</label>
                <input type="text" name="mobile" dtype="mobile" class="form-control" maxlength="15" placeholder="新会员名" required />
            </div>
            <p class="help-block">请输入手机号码</p>
        </div>

        <input type="hidden" name="id" value="{[item.id]}">
    </form>
</script>

<script type="text/html" id="modify-pass-template">
    <form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 新密码</label>
                <input type="password" name="password" class="form-control" id="password" min-length="6" maxlength="20" placeholder="新密码" required />
            </div>
            <p class="help-block">请输入6-20位的密码</p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 确认密码</label>
                <input type="password" dtype="repass" for-password="password" class="form-control" min-length="6" maxlength="20" placeholder="确认密码" required />
            </div>
            <p class="help-block">请输入6-20位的密码</p>
        </div>

        <input type="hidden" name="id" value="{[item.id]}">
    </form>
</script>

<script type="text/html" id="sign-bank-template">
    <form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 支付通道</label>
                <div>
                    {loop $payways $value}
                    <img src="{$value[icon]}" data-payway="{$value[id]}" style="max-width: 150px;" class="img-thumbnail {[if item.payway=='{$value[id]}']}selected{[/if]}">
                    {/loop}
                    <input type="hidden" name="data[payway]" value="{[item.payway]}" empty-message="请选择支付通道" required>
                </div>
            </div>
            <p class="help-block">支付通道对应了不同的银行接口</p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 姓名</label>
                <input type="text" class="form-control"  value="{[item.legal_person]}" placeholder="姓名" readonly/>
                <input type="hidden" name="data[legal_person]" value="{[item.legal_person]}">
            </div>
            <p class="help-block">您只能绑定与实名认证信息一致的银行卡</p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 银行卡号</label>
                <input type="text" name="data[card_no]" value="{[item.card_no]}" class="form-control" placeholder="银行卡号" required />
            </div>
            <p class="help-block">填入使用实名认证的身份证开户的银行卡号</p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 开户银行</label>
                <div class="input-group">
                    <input type="text" name="data[sign_bank_branch]" value="{[item.sign_bank_branch]}" class="form-control" placeholder="请选择开户银行" readonly />
                    <span class="input-group-btn">
						<button class="btn btn-info select-bank" type="button">选择银行</button>
					</span>
                </div>
                <input type="hidden" name="data[sign_bank_code]" value="{[item.sign_bank_code]}" required />
                <input type="hidden" name="data[sign_bank_id]" value="{[item.sign_bank_id]}" required />
            </div>
            <p class="help-block"></p>
        </div>

        <input type="hidden" name="id" value="{[item.id]}">
    </form>
</script>

<script type="text/html" id="bank-query-template">
    <form role="form" class="content-add-form">

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 选择银行</label>
                <select class="form-control" id="sign_bank_id">
                    {loop $banks $value}
                    <option value="{$value[id]}">{$value[name]}</option>
                    {/loop}
                </select>

            </div>
            <p class="help-block"></p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 选择城市</label>
                <div class="form-inline area-select" id="bank-area-select"></div>
            </div>
            <p class="help-block">选择城市后会自动加载该城市的银行支行</p>
        </div>

        <div class="form-element">
            <div class="form-group">
                <label><span class="asterisk">*</span> 选择支行</label>
                <div class="input-group">
                    <input type="text" id="branch-keyword" class="form-control" placeholder="请输入支行关键字" required />
                    <span class="input-group-btn">
						<button class="btn btn-success" type="button"  id="query">查询</button>
					</span>
                </div>
            </div>
            <p class="help-block">输入支行关键字查询，并在查询结果列表中选择支行</p>
        </div>

        <div class="form-element">
            <div id="bank-list" style="height: 200px; overflow: auto;">

            </div>
        </div>

    </form>
</script>

<script type="text/html" id="bank-list-template">
    <table class="table table-hover">
        {[each items as value]}
        <tr style="cursor: pointer;">
            <td data-code="{[value.number]}">{[value.name]}</td>
        </tr>
        {[/each]}
    </table>
</script>



<script>
    seajs.use("user", function(exports) {
        var configs = {
            set_url : '/admin/user/set/',
            modifyMobile_url : '/admin/user/modifyMobile/',
            modifyPass_url : '/admin/user/modifyPass/',
            signBank_url : '/admin/user/signBank/'
        };
        exports.init(configs);
        exports.modifyMobile(configs);
        exports.modifyPass(configs);
    });

    seajs.use('signBank', function(exports) {

        var configs = {
            signBank_url : '/admin/user/signBank/',
            dosignBank_url : '/admin/user/dosignBank/'
        };
        exports.init(configs);

    });
</script>
</body>
</html>
